<?php if (! defined('APPPATH')) die('No direct script access allowed');
/**
 * RENARTI IK
 * An open source application development framework for PHP 5.2.0 or newer
 *
 * @package		RtiFramework
 * @author		Nauris Dambis <nauris.dambis@renarti.com>
 * @copyright	Copyright (c) 2012, RENARTI IK.
 * @license		http://renarti.com/#license
 * @link		http://renarti.com
 * @since		Version 1.0
 */

class RtiController
{
	/**
	 * Allows Controller or extended controllers to access Rti loaded classes 
	 *
	 * @access	public
	 * @param	string $key
	 * @return	mixed
	 */
	public function __get($key)
	{
		$objects = Rti::getLoadedObjects();
		
		if (isset($objects[$key]))
		{
			return $objects[$key];
		}
		else 
		{
			if (substr($key, 0, 1) != '_')
			{
				$methods = get_class_methods('Rti');
				
				if (in_array($key, $methods))
				{
					return Rti::$key();
				}
				else 
				{
					return FALSE;
				}
			}
			else
			{
				return FALSE;
			}
		}
	}
}

/* End of file RtiController.php */
/* Location: ./system/core/RtiController.php */
